package com.zys.el.security.dao;

import com.zys.el.core.dao.ICrudDao;
import com.zys.el.security.po.Role;
import com.zys.el.security.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface RoleDao extends ICrudDao<Role> {

    /**
     * 删除用户角色关联
     *
     * @param id
     * @return
     */
    public int deleteUserByRole(Long id);

    /**
     * 关联角色用户
     *
     * @param userId
     * @param roleId
     * @return
     */
    public int insertUserAndRole(@Param("userId") Long userId, @Param("roleId") Long roleId);


    /**
     * 查询角色的用户
     *
     * @param id
     * @return
     */
    public List<User> selectUserByRole(Long id);

}
